package com.team.service.Impl;


import java.util.List;

import javax.transaction.Transactional;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.team.dao.UserDao;
import com.team.entity.Admin;
import com.team.entity.User;
import com.team.service.UserService;
@Service
@Transactional
public class UserServiceImpl implements UserService {
	
	@Autowired
	private UserDao userDaoImpl;
	
	public void saveuser(User user) {
		
		userDaoImpl.saveuser(user);
	
	}
	@Override
	public User seleu(String username) {
		return userDaoImpl.seleu(username);
	}
	@Override
	public User seleuser(String username, String password) {
		return userDaoImpl.seleuser(username, password);
	}

	@Override
	public Admin seleadmin(String username, String password) {
		return userDaoImpl.seleadmin(username, password);
	}

	@Override
	public Admin selea(int id) {
		return userDaoImpl.selea(id);
	}
	@Override
	public boolean upadmin(Admin admin) {
		userDaoImpl.upadmin(admin);
		return true;
	}
	@Override
	public boolean upuser(User user) {
		userDaoImpl.upuser(user);
		return true;
	}
	@Override
	public List<User> alluser() {
		return userDaoImpl.alluser();
		
	}
	@Override
	public boolean deleuser(int id) {
		boolean deleuser = userDaoImpl.deleuser(id);
		return deleuser;
	}
	@Override
	public User selepassword(String username, String no, String name, String department) {
		return userDaoImpl.selepassword(username, no, name, department);
	}	
}
